package com.huixuebao.pay.config;


import com.github.binarywang.wxpay.config.WxPayConfig;
import com.github.binarywang.wxpay.service.WxPayService;
import com.github.binarywang.wxpay.service.impl.WxPayServiceImpl;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class WxConfig {

    private static final String APPID = "wxce853ff38e71b054";
    private static final String APPSECRET = "6fc7f62eb738dad16e2797798aa44d51";
    private static final String MCHID = "1604306719";
    private static final String PATERNERKEY = "4a9f2c433adcc2698ba7704faedeaf82";

    @Bean
    public WxPayService wxPayService() {
        WxPayConfig payConfig = new WxPayConfig();
        payConfig.setAppId(APPID);
        payConfig.setMchId(MCHID);
        payConfig.setMchKey(PATERNERKEY);
        payConfig.setNotifyUrl("https://officialaccount.huizhuanqian.net:8086/wxPay/notify");

        WxPayService wxPayService = new WxPayServiceImpl();
        wxPayService.setConfig(payConfig);
        return wxPayService;
    }
}
